Python Data Analysis, Third Edition by Unknown
Author: Unknown , Date: March 22, 2022
, Views: 982
In the preceding example, we filtered employees on the basis of their performance score (performance_score >=700). Now, let's filter data using multiple conditions:
# Filter employee who has more than 500 and less than 700 performance score
data[(data.performance_score >=500) & (data.performance_score < 700)]
This results in the following output:
We can also try the query() method. This method queries the columns using a boolean expression. Let's look at an example:
# Filter employee who has performance score of less than 500
data.query('performance_score<500')
This results in the following output:
Copyright Disclaimer:
This site does not store any files on its server. We only index and link
to content provided by other sites. Please contact the content providers
to delete copyright contents if any and email us, we'll remove relevant
links or contents immediately.